/**
 * 
 */
package com.feonix.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * @CopyRight (c)1993-2017
 * @Project common_practice
 * @Comments 请输入该类的描述
 * @NameSpace com.feonix.io
 * @Author Feonixzw
 * @CreateDate 2017年12月5日
 */
public class IOTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		InputStream is = null;
		OutputStream os = null;
		try {
			byte[] buffer = new byte[1024];
			is = new FileInputStream(new File("C:/Users/Administrator/Desktop/1.jpg"));
			os = new FileOutputStream(new File("C:/Users/Administrator/Desktop/2.jpg"));
			int length = 0;
			while((length = is.read(buffer)) != -1){
				os.write(buffer, 0, length);
			}
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			try {
				is.close();
				os.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}

	}

}
